import {FC,useEffect} from 'react';
import Consumer from './consumer';
import style from './addUser.less';
import {useDispatch} from 'umi';
import consumerConfig from '@/utils/consumer.config';

const AddUser:FC = () => {
    const dispatch = useDispatch();

    useEffect(() => {
        //身份id
        dispatch({
            type:'consumer/getUserIdentity'
        })
        //获取已有视图权限数据
        dispatch({
            type:'consumer/getviewAuthority'
        })
        //获取api权限数据
        dispatch({
            type:'consumer/getApiAuthority'
        })
    },[])

    return <div className={style.addUserWrap}>
        {consumerConfig.map((item:any) => <Consumer key={item.id} item={item}></Consumer>)}
    </div>
}

export default AddUser